package com.atguigu.upp.service;

import com.atguigu.upp.mapper.CkMapper;
import com.atguigu.upp.util.UPPUtil;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.SqlSession;

/**
 * Created by Smexy on 2023/3/25
 */
public class CKService
{
    private CkMapper ckMapper;

    public CKService(SqlSession sqlSession) {
        ckMapper = sqlSession.getMapper(CkMapper.class);
    }

    public void createWideTable(String tableName, String col) {

        UPPUtil.validParams(tableName, col);

        ckMapper.createTable(tableName, col);

    }

    ;

    public void deleteBitmap(String name, String dt) {

        UPPUtil.validParams(name, dt);

        ckMapper.deleteBitmapData(name, dt);

    }

    public void generateUserGroup(String target, String dt, String tags, String db, String source) {
        UPPUtil.validParams(target, dt, tags, db, source);
        ckMapper.generateUserGroup(target, dt, tags, db, source);
    }

    public void dropWideTable(String name) {

        UPPUtil.validParams(name);

        ckMapper.dropTable(name);

    }
}
